<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="box"></div>
    <script src="../template-web.js"></script>
    <script src="../jquery-v3.6.0.js"></script>
    <script type="text/html" id="templ">
        <h1>msg的值是{{msg}}</h1>
    </script>
    <script>
        $(function(){
            const data = {
                msg:'hello wolrd'
            }
            const htmlStr = template('templ',data)
            $('.box').html(htmlStr)
        })
    </script>
</body>
</html>